package com.wispx.shortlink.admin.toolkit;

import java.util.Random;

/**
 * 分组ID随机生成器
 */
public final class RandomStringGenerator {

    /**
     * 随机生成6位分组ID
     *
     * @return 分组ID
     */
    public static String generateRandomString() {
        String characters = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
        StringBuilder result = new StringBuilder(6);
        Random random = new Random();
        for (int i = 0; i < 6; i++) {
            int index = random.nextInt(characters.length());
            result.append(characters.charAt(index));
        }
        return result.toString();
    }
}
